<script setup lang="ts">
import { onMounted, ref } from 'vue';
import { useRouter } from 'vue-router';
const router = useRouter();
const isMobile = ref<boolean>(false);
// 根据UA判断是否未移动端
const flag = navigator.userAgent.match(
  /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i,
);
isMobile.value = !!(flag || navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1);
onMounted(() => {
  if (isMobile.value) {
    router.push({ path: '/pay/mobile' });
  } else {
    router.push({ path: '/pay/index' });
  }
});
</script>
<style scoped></style>
